﻿Public Class CLS_DISENIO_ALTERNATIVA

    Public Function AddAlternativa(ByRef Rp As DotNetResponse.SQLPersistence, ByVal P_RESPUESTA As Decimal, ByVal K_TIPO_PREGUNTA As Decimal, ByVal K_PREGUNTA As Decimal, ByVal I_FILA As Integer, ByVal S_R1 As String, ByVal S_R2 As String, ByVal S_R3 As String, ByVal S_R4 As String, ByVal S_R5 As String, ByVal S_CORRECTA As String, ByVal I_PUNTOS As Integer, ByVal M_R1 As Byte(), ByVal M_R2 As Byte(), ByVal M_R3 As Byte(), ByVal M_R4 As Byte(), ByVal M_R5 As Byte(), ByVal S_AUD_USUARIO_C As String, ByVal S_AUD_USUARIO_M As String, ByVal D_AUD_FECHA_C As String, ByVal D_AUD_FECHA_M As String, Optional ByVal Url1 As String = "", Optional ByVal Url2 As String = "", Optional ByVal Url3 As String = "", Optional ByVal Url4 As String = "", Optional ByVal Url5 As String = "")

        Dim Rpexec As New DotNetResponse.SQLPersistence
        Rpexec.AddParametro(P_RESPUESTA)
        Rpexec.AddParametro(K_TIPO_PREGUNTA)
        Rpexec.AddParametro(K_PREGUNTA)
        Rpexec.AddParametro(I_FILA)
        Rpexec.AddParametro(S_R1)
        Rpexec.AddParametro(S_R2)
        Rpexec.AddParametro(S_R3)
        Rpexec.AddParametro(S_R4)
        Rpexec.AddParametro(S_R5)
        Rpexec.AddParametro(S_CORRECTA)
        Rpexec.AddParametro(I_PUNTOS)
        Rpexec.AddParametro(M_R1)
        Rpexec.AddParametro(M_R2)
        Rpexec.AddParametro(M_R3)
        Rpexec.AddParametro(M_R4)
        Rpexec.AddParametro(M_R5)
        Rpexec.AddParametro(S_AUD_USUARIO_C)
        Rpexec.AddParametro(S_AUD_USUARIO_M)
        Rpexec.AddParametro(D_AUD_FECHA_C)
        Rpexec.AddParametro(D_AUD_FECHA_M)
        Rpexec.AddParametro(Url1)
        Rpexec.AddParametro(Url2)
        Rpexec.AddParametro(Url3)
        Rpexec.AddParametro(Url4)
        Rpexec.AddParametro(Url5)

        Rpexec.StoredProcedure = "SP_INSERTA_PRUEBA_DISENO_ALTERNATIVA"

        Dim Exec As New DotNetDal.SQLPersistence(True, "cnn", DotNetDal.SQLPersistence.Provider.SQLCLIENT)
        Exec.ExecuteDataTable(Rpexec)
        Exec.Commit()
        Exec.Dispose()

        Rp.DtTable = Rpexec.DtTable
        Rp.TieneDatos = Rpexec.TieneDatos
        Rp.Errores = Rpexec.Errores
        Rp.MensajeError = Rpexec.MensajeError




    End Function

    Public Function GetAlternativa(ByRef Rp As DotNetResponse.SQLPersistence, ByVal K_PREGUNTA As Decimal)

        Dim Rpexec As New DotNetResponse.SQLPersistence
        Rpexec.AddParametro(K_PREGUNTA)

        Rpexec.StoredProcedure = "SP_OBTIENE_PRUEBA_DISENO_ALTERNATIVA"

        Dim Exec As New DotNetDal.SQLPersistence(True, "cnn", DotNetDal.SQLPersistence.Provider.SQLCLIENT)
        Exec.ExecuteDataTable(Rpexec)
        Exec.Commit()
        Exec.Dispose()

        Rp.DtTable = Rpexec.DtTable
        Rp.TieneDatos = Rpexec.TieneDatos
        Rp.Errores = Rpexec.Errores
        Rp.MensajeError = Rpexec.MensajeError




    End Function

End Class
